<template>
	<view class="cell-body">
		<view class="cell-list" hover-class="hover-cell" :hover-stay-time="250" @click="goUrl">
			<view style="margin-right: 8rpx;">
				<u-icon :name="icon" size="18" v-if="icon" ></u-icon>
			</view>
			<text>{{title}}</text>
			<view class="cell-value">
				<text>{{value}}</text>
				<u-icon name="arrow-right" size="16" v-if="isLink" color="#909399"></u-icon>
			</view>
		</view>
		<view class="cell-content">
			<slot name="content">{{content}}</slot>
		</view>
		<view class="cell-line"></view>
	</view>
</template>

<script>
	export default {
		name: 'cell',
		data() {
			return {
	
			}
		},
		props:{
			icon:{
				type: String,
				default: ''
			},
			title:{
				type: String,
				default: ''
			},
			isLink:{
				type: Boolean,
				default: true
			},
			value:{
				type: String,
				default: ''
			},
			url:{
				type: String,
				default: ''
			}
		},
		methods: {
			goUrl:function(){
				if(!this.url)return;
				uni.navigateTo({
					url:'/pages/'+this.url
				});
			}
		}
	}
</script>

<style lang="scss">
	.cell-list{
		display: flex;
		flex-direction: row;
		box-sizing: border-box;
		padding: 20rpx 30rpx;
		font-size: 30rpx;
		color: #303133;
		align-items: center;
	}
	.cell-line{
		border-bottom-width: 1px;
		border-bottom-style: solid;
		width: 100%;
		transform: scaleY(0.5);
		border-color: #d6d7d9;
	}
	.cell-value{
		position: absolute;
		right: 30rpx;
		display: flex;
		align-items: center;
		text{
			margin-right: 10rpx;
		}
	}
	.hover-cell{
		background-color: #d6d7d9;
	}
</style>
